<template>
  <n-layout>
    <n-layout class="h-16">
      <!-- 头部 -->
      <head-module />
    </n-layout>
    <n-layout class="h-16 bg-red-700"> 头 </n-layout>
  </n-layout>
</template>

<script setup>
/**
 *
 */
import { watchEffect, ref, onMounted } from "vue";
/**
 * 路由器
 */
import { menuOptions } from "@/router/router";
/**
 *
 */
import { routesToMenu } from "@/utils/index";
/**
 *
 */
import { useRouter } from "vue-router";

/**
 *  头部
 */
import HeadModule from "@/components/head/HeadModule.vue";

// 获取路由实例
const router = useRouter();

/**
 *
 */
onMounted(() => {
  console.log("1", router);
});

/**
 *
 * @param key
 * @param item
 */
function onUpdateValue(key, item) {
  if (router.hasRoute(key)) {
    router.push({ name: key });
    console.log("1");
  } else {
    router.push({ path: key });
    console.log("2");
  }
  active.value = key;
  console.log("地址", active.value);
}
</script>
